trigger DealSharing on Opportunity(after update,after insert)
{

if(trigger.isinsert)
{

List<OpportunityShare> OppShare1 = new List<OpportunityShare>();


for(opportunity opp:trigger.new)
   {

   if(opp.StageName=='Closed Won' || opp.StageName=='Closed Lost')
       {

       OpportunityShare OppShare = new OpportunityShare();

               OppShare.OpportunityId=opp.id;
               OppShare.UserOrGroupId='00GC0000002P3lq';
               OppShare.OpportunityAccessLevel='Read';

               OppShare1.add(OppShare);

       }
   }
insert Oppshare1 ;

}
}